﻿using Terraria;
using Terraria.GameContent.Creative;
using Terraria.ModLoader;
using Terraria.ID;

namespace EAS.Content.Items
{
    public class UnderwaterMagnifier : ModItem
    {
        public override void SetStaticDefaults()
        {
            CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
        }
        public override void SetDefaults()
        {
            Item.width = 34;
            Item.height = 34;
            Item.rare = ItemRarityID.Green;
            Item.value = Item.sellPrice(0, 3, 50, 0);
            Item.accessory = true;
        }
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            if (player.wet)
            {
                player.AddBuff(BuffID.Spelunker, 60 * 45);
                player.AddBuff(BuffID.Dangersense, 60 * 45);
                player.AddBuff(BuffID.Hunter, 60 * 45);
            }            
        }
        public override void AddRecipes()
        {
            Recipe modRecipe = Recipe.Create(Type, 1);
            modRecipe.AddIngredient(ItemID.Lens, 1);
            modRecipe.AddIngredient(ItemID.Glass, 15);
            modRecipe.AddTile(TileID.MythrilAnvil);
            modRecipe.Register();
        }

    }
}
